package view;

import java.awt.Dimension;
import javax.swing.*;
import model.db.table.BidHistory;

/**
 * Author: Raoux Etienne
 * Student login: jc218934
 * Student number: 12448190
 * email: etienne.raoux@my.jcu.edu.au
 * alt email: jc218934@gmail.com
 */
public class ItemBidHistoryView extends JFrame
{
    private final BidHistory bidHistory;

    ItemBidHistoryView(BidHistory bidHistory)
    {
        this.bidHistory = bidHistory;
        setTitle(bidHistory.getTitle()+" Bid History");
        JScrollPane scrollPane = new JScrollPane();
        JTextArea textArea = new JTextArea();
        textArea.setText(bidHistory.toString());
        scrollPane.setViewportView(textArea);
        
        add(scrollPane);
        getContentPane().setLayout(new java.awt.GridLayout());
        Dimension dim = textArea.getPreferredSize();
        dim.setSize(dim.width+20, dim.height);
        scrollPane.setPreferredSize(dim);
        pack();
    }

    void start()
    {
        setVisible(true);
    }
    
}
